<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Data::Float - details of the floating point data type - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Data-Float - MetaCPAN" href="https://metacpan.org/dist/Data-Float/releases.rss" />
        <link rel="canonical" href="./Data::Float.html" />
        <meta name="description" content="details of the floating point data type" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Data::Float" />
<meta name="twitter:title"       content="Data::Float" />
<meta name="twitter:description" content="details of the floating point data type" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Data::Float.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Data-Float was released.">
      <span class="relatize">29 Jul 2017 19:40:41 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Data-Float">Data-Float</a>
  </li>
  <li>
    Module version: 0.013
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Data-Float/source/lib/Data/Float.pm">Source</a>
    (<a href="https://metacpan.org/dist/Data-Float/source/lib/Data/Float.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Data-Float/source/lib/Data">Browse</a>
    (<a href="https://metacpan.org/dist/Data-Float/source/lib/Data?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Data-Float/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Data-Float/contribute">How to Contribute</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Float">Issues</a>
      (0)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Data-Float+0.013" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Float.html?oncpan=1&amp;distmat=1&amp;version=0.013&amp;grade=2" style="color: #090">682</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Float.html?oncpan=1&amp;distmat=1&amp;version=0.013&amp;grade=3" style="color: #900">1</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Float.html?oncpan=1&amp;distmat=1&amp;version=0.013&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/ZEFRAM/Data-Float-0.013">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Data-Float who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Data-Float-0.013/index.html">84.80% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li>
      Perl: v5.6.0
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Data-Float/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/Z/ZE/ZEFRAM/Data-Float-0.013.tar.gz">
      Download (<span itemprop="fileSize">25.33KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FZEFRAM%2FData-Float-0.013%2Flib%2FData%2FFloat.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Data-Float/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Data-Float/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Data-Float">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Data-Float">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Data/Float.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="ZEFRAM/Data-Float-0.013"
>0.013
  (ZEFRAM on 2017-07-29)</option>
<option
  
  value="ZEFRAM/Data-Float-0.012"
>0.012
  (ZEFRAM on 2012-02-04)</option>
<option
  
  value="ZEFRAM/Data-Float-0.011"
>0.011
  (ZEFRAM on 2010-10-21)</option>
<option
  
  value="ZEFRAM/Data-Float-0.010"
>0.010
  (ZEFRAM on 2010-07-26)</option>
<option
  
  value="ZEFRAM/Data-Float-0.009"
>0.009
  (ZEFRAM on 2008-04-06)</option>
<optgroup label="BackPAN">'
<option
  
  value="ZEFRAM/Data-Float-0.008"
>0.008
  (ZEFRAM on 2008-04-02)</option>
<option
  
  value="ZEFRAM/Data-Float-0.007"
>0.007
  (ZEFRAM on 2007-10-02)</option>
<option
  
  value="ZEFRAM/Data-Float-0.006"
>0.006
  (ZEFRAM on 2007-10-01)</option>
<option
  
  value="ZEFRAM/Data-Float-0.005"
>0.005
  (ZEFRAM on 2007-01-25)</option>
<option
  
  value="ZEFRAM/Data-Float-0.004"
>0.004
  (ZEFRAM on 2007-01-12)</option>
<option
  
  value="ZEFRAM/Data-Float-0.003"
>0.003
  (ZEFRAM on 2006-08-08)</option>
<option
  
  value="ZEFRAM/Data-Float-0.002"
>0.002
  (ZEFRAM on 2006-08-03)</option>
<option
  
  value="ZEFRAM/Data-Float-0.001"
>0.001
  (ZEFRAM on 2006-08-01)</option>
<option
  
  value="ZEFRAM/Data-Float-0.000"
>0.000
  (ZEFRAM on 2006-07-30)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/ZEFRAM/Data-Float-0.013/diff/' + encodeURIComponent(this.value) + '/lib/Data/Float.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="ZEFRAM/Data-Float-0.013"
>0.013
  (ZEFRAM on 2017-07-29)</option>
<option
  
  value="ZEFRAM/Data-Float-0.012"
>0.012
  (ZEFRAM on 2012-02-04)</option>
<option
  
  value="ZEFRAM/Data-Float-0.011"
>0.011
  (ZEFRAM on 2010-10-21)</option>
<option
  
  value="ZEFRAM/Data-Float-0.010"
>0.010
  (ZEFRAM on 2010-07-26)</option>
<option
  
  value="ZEFRAM/Data-Float-0.009"
>0.009
  (ZEFRAM on 2008-04-06)</option>
<optgroup label="BackPAN">'
<option
  
  value="ZEFRAM/Data-Float-0.008"
>0.008
  (ZEFRAM on 2008-04-02)</option>
<option
  
  value="ZEFRAM/Data-Float-0.007"
>0.007
  (ZEFRAM on 2007-10-02)</option>
<option
  
  value="ZEFRAM/Data-Float-0.006"
>0.006
  (ZEFRAM on 2007-10-01)</option>
<option
  
  value="ZEFRAM/Data-Float-0.005"
>0.005
  (ZEFRAM on 2007-01-25)</option>
<option
  
  value="ZEFRAM/Data-Float-0.004"
>0.004
  (ZEFRAM on 2007-01-12)</option>
<option
  
  value="ZEFRAM/Data-Float-0.003"
>0.003
  (ZEFRAM on 2006-08-08)</option>
<option
  
  value="ZEFRAM/Data-Float-0.002"
>0.002
  (ZEFRAM on 2006-08-03)</option>
<option
  
  value="ZEFRAM/Data-Float-0.001"
>0.001
  (ZEFRAM on 2006-08-01)</option>
<option
  
  value="ZEFRAM/Data-Float-0.000"
>0.000
  (ZEFRAM on 2006-07-30)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Carp" title="Carp" class="ellipsis">Carp</a></li>
  <li><a href="https://metacpan.org/pod/Exporter" title="Exporter" class="ellipsis">Exporter</a></li>
  <li><a href="https://metacpan.org/pod/constant" title="constant" class="ellipsis">constant</a></li>
  <li><a href="https://metacpan.org/pod/integer" title="integer" class="ellipsis">integer</a></li>
  <li><a href="https://metacpan.org/pod/parent" title="parent" class="ellipsis">parent</a></li>
  <li><a href="https://metacpan.org/pod/strict" title="strict" class="ellipsis">strict</a></li>
  <li><a href="https://metacpan.org/pod/warnings" title="warnings" class="ellipsis">warnings</a></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Data::Float/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Data%3A%3AFloat">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Data-Float">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/ZEFRAM/Data-Float-0.013/view/lib/Data/Float.pm">This version</a>
    </li>
    <li>
      <a href="./Data::Float.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/SYP"><img src="https://www.gravatar.com/avatar/9b6fa62677be03c25ee1af4d95472042?d=identicon&amp;s=20" title="SYP" alt="SYP"></a>
<a class="display-all" href="https://metacpan.org/author/BKB"><img src="https://www.gravatar.com/avatar/191945c6c283d81db701008b2d89b68c?d=identicon&amp;s=20" title="BKB" alt="BKB"></a>
<a class="display-all" href="https://metacpan.org/author/AYOUNG"><img src="https://www.gravatar.com/avatar/8d1e4946c288fbe87d1e0394f3e41b24?d=identicon&amp;s=20" title="AYOUNG" alt="AYOUNG"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Data-Float/plussers">3 PAUSE users</a>
</div>
</div>
    </li>
    <li>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/ZEFRAM" class="author-name">Andrew Main (Zefram)</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Data/Float.pm&#39;" class="">
<option
  selected
  value="ZEFRAM/Data-Float-0.013"
>0.013
  (ZEFRAM on 2017-07-29)</option>
<option
  
  value="ZEFRAM/Data-Float-0.012"
>0.012
  (ZEFRAM on 2012-02-04)</option>
<option
  
  value="ZEFRAM/Data-Float-0.011"
>0.011
  (ZEFRAM on 2010-10-21)</option>
<option
  
  value="ZEFRAM/Data-Float-0.010"
>0.010
  (ZEFRAM on 2010-07-26)</option>
<option
  
  value="ZEFRAM/Data-Float-0.009"
>0.009
  (ZEFRAM on 2008-04-06)</option>
<optgroup label="BackPAN">'
<option
  
  value="ZEFRAM/Data-Float-0.008"
>0.008
  (ZEFRAM on 2008-04-02)</option>
<option
  
  value="ZEFRAM/Data-Float-0.007"
>0.007
  (ZEFRAM on 2007-10-02)</option>
<option
  
  value="ZEFRAM/Data-Float-0.006"
>0.006
  (ZEFRAM on 2007-10-01)</option>
<option
  
  value="ZEFRAM/Data-Float-0.005"
>0.005
  (ZEFRAM on 2007-01-25)</option>
<option
  
  value="ZEFRAM/Data-Float-0.004"
>0.004
  (ZEFRAM on 2007-01-12)</option>
<option
  
  value="ZEFRAM/Data-Float-0.003"
>0.003
  (ZEFRAM on 2006-08-08)</option>
<option
  
  value="ZEFRAM/Data-Float-0.002"
>0.002
  (ZEFRAM on 2006-08-03)</option>
<option
  
  value="ZEFRAM/Data-Float-0.001"
>0.001
  (ZEFRAM on 2006-08-01)</option>
<option
  
  value="ZEFRAM/Data-Float-0.000"
>0.000
  (ZEFRAM on 2006-07-30)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Data-Float">Data-Float-0.013</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage two &#10;
          • 9 direct dependents &#10;          • 63 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Data-Float-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Data-Float-0.013">
    <input type="hidden" name="author" value="ZEFRAM">
    <input type="hidden" name="distribution" value="Data-Float">
    <button type="submit" class="favorite highlight"><span>3</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Data::Float.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>3</span> ++</a>
</div>
   / <span>Data::Float</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Data::Float.html#NAME">NAME</a></li>
  <li><a href="./Data::Float.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Data::Float.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Data::Float.html#FLOATING-POINT">FLOATING POINT</a>
    <ul>
      <li><a href="./Data::Float.html#Classification">Classification</a></li>
      <li><a href="./Data::Float.html#Mixing-floating-point-and-integer-values">Mixing floating point and integer values</a></li>
    </ul>
  </li>
  <li><a href="./Data::Float.html#CONSTANTS">CONSTANTS</a>
    <ul>
      <li><a href="./Data::Float.html#Features">Features</a></li>
      <li><a href="./Data::Float.html#Extrema">Extrema</a></li>
      <li><a href="./Data::Float.html#Special-Values">Special Values</a></li>
    </ul>
  </li>
  <li><a href="./Data::Float.html#FUNCTIONS">FUNCTIONS</a>
    <ul>
      <li><a href="./Data::Float.html#Classification1">Classification</a></li>
      <li><a href="./Data::Float.html#Examination">Examination</a></li>
      <li><a href="./Data::Float.html#String-conversion">String conversion</a></li>
      <li><a href="./Data::Float.html#Comparison">Comparison</a></li>
      <li><a href="./Data::Float.html#Manipulation">Manipulation</a></li>
    </ul>
  </li>
  <li><a href="./Data::Float.html#BUGS">BUGS</a></li>
  <li><a href="./Data::Float.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./Data::Float.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./Data::Float.html#COPYRIGHT">COPYRIGHT</a></li>
  <li><a href="./Data::Float.html#LICENSE">LICENSE</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Data::Float - details of the floating point data type</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    use Data::Float qw(have_signed_zero);

    if(have_signed_zero) { ...

    # and many other constants; see text

    use Data::Float qw(
        float_class float_is_normal float_is_subnormal
        float_is_nzfinite float_is_zero float_is_finite
        float_is_infinite float_is_nan);

    $class = float_class($value);

    if(float_is_normal($value)) { ...
    if(float_is_subnormal($value)) { ...
    if(float_is_nzfinite($value)) { ...
    if(float_is_zero($value)) { ...
    if(float_is_finite($value)) { ...
    if(float_is_infinite($value)) { ...
    if(float_is_nan($value)) { ...

    use Data::Float qw(float_sign signbit float_parts);

    $sign = float_sign($value);
    $sign_bit = signbit($value);
    ($sign, $exponent, $significand) = float_parts($value);

    use Data::Float qw(float_hex hex_float);

    print float_hex($value);
    $value = hex_float($string);

    use Data::Float qw(float_id_cmp totalorder);

    @sorted_floats = sort { float_id_cmp($a, $b) } @floats;
    if(totalorder($a, $b)) { ...

    use Data::Float qw(
        pow2 mult_pow2 copysign nextup nextdown nextafter);

    $x = pow2($exp);
    $x = mult_pow2($value, $exp);
    $x = copysign($magnitude, $sign_from);
    $x = nextup($x);
    $x = nextdown($x);
    $x = nextafter($x, $direction);</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module is about the native floating point numerical data type. A floating point number is one of the types of datum that can appear in the numeric part of a Perl scalar. This module supplies constants describing the native floating point type, classification functions, and functions to manipulate floating point values at a low level.</p>

<h1 id="FLOATING-POINT"><a id="FLOATING"></a>FLOATING POINT</h1>

<h2 id="Classification">Classification</h2>

<p>Floating point values are divided into five subtypes:</p>

<dl>

<dt id="normalised">normalised</dt>
<dd>

<p>The value is made up of a sign bit (making the value positive or negative), a significand, and exponent. The significand is a number in the range [1, 2), expressed as a binary fraction of a certain fixed length. (Significands requiring a longer binary fraction, or lacking a terminating binary representation, cannot be obtained.) The exponent is an integer in a certain fixed range. The magnitude of the value represented is the product of the significand and two to the power of the exponent.</p>

</dd>
<dt id="subnormal">subnormal</dt>
<dd>

<p>The value is made up of a sign bit, significand, and exponent, as for normalised values. However, the exponent is fixed at the minimum possible for a normalised value, and the significand is in the range (0, 1). The length of the significand is the same as for normalised values. This is essentially a fixed-point format, used to provide gradual underflow. Not all floating point formats support this subtype. Where it is not supported, underflow is sudden, and the difference between two minimum-exponent normalised values cannot be exactly represented.</p>

</dd>
<dt id="zero">zero</dt>
<dd>

<p>Depending on the floating point type, there may be either one or two zero values: zeroes may carry a sign bit. Where zeroes are signed, it is primarily in order to indicate the direction from which a value underflowed (was rounded) to zero. Positive and negative zero compare as numerically equal, and they give identical results in most arithmetic operations. They are on opposite sides of some branch cuts in complex arithmetic.</p>

</dd>
<dt id="infinite">infinite</dt>
<dd>

<p>Some floating point formats include special infinite values. These are generated by overflow, and by some arithmetic cases that mathematically generate infinities. There are two infinite values: positive infinity and negative infinity.</p>

<p>Perl does not always generate infinite values when normal floating point behaviour calls for it. For example, the division <code>1.0/0.0</code> causes an exception rather than returning an infinity.</p>

</dd>
<dt id="not-a-number-(NaN)"><a id="not"></a><a id="not-a-number--NaN"></a>not-a-number (NaN)</dt>
<dd>

<p>This type of value exists in some floating point formats to indicate error conditions. Mathematically undefined operations may generate NaNs, and NaNs propagate through all arithmetic operations. A NaN has the distinctive property of comparing numerically unequal to all floating point values, including itself.</p>

<p>Perl does not always generate NaNs when normal floating point behaviour calls for it. For example, the division <code>0.0/0.0</code> causes an exception rather than returning a NaN.</p>

<p>Perl has only (at most) one NaN value, even if the underlying system supports different NaNs. (IEEE 754 arithmetic has NaNs which carry a quiet/signal bit, a sign bit (yes, a sign on a not-number), and many bits of implementation-defined data.)</p>

</dd>
</dl>

<h2 id="Mixing-floating-point-and-integer-values"><a id="Mixing"></a>Mixing floating point and integer values</h2>

<p>Perl does not draw a strong type distinction between native integer (see <a href="https://metacpan.org/pod/Data::Integer">Data::Integer</a>) and native floating point values. Both types of value can be stored in the numeric part of a plain (string) scalar. No distinction is made between the integer representation and the floating point representation where they encode identical values. Thus, for floating point arithmetic, native integer values that can be represented exactly in floating point may be freely used as floating point values.</p>

<p>Native integer arithmetic has exactly one zero value, which has no sign. If the floating point type does not have signed zeroes then the floating point and integer zeroes are exactly equivalent. If the floating point type does have signed zeroes then the integer zero can still be used in floating point arithmetic, and it behaves as an unsigned floating point zero. On such systems there are therefore three types of zero available. There is a bug in Perl which sometimes causes floating point zeroes to change into integer zeroes; see <a href="./Data::Float.html#BUGS">&quot;BUGS&quot;</a> for details.</p>

<p>Where a native integer value is used that is too large to exactly represent in floating point, it will be rounded as necessary to a floating point value. This rounding will occur whenever an operation has to be performed in floating point because the result could not be exactly represented as an integer. This may be confusing to functions that expect a floating point argument.</p>

<p>Similarly, some operations on floating point numbers will actually be performed in integer arithmetic, and may result in values that cannot be exactly represented in floating point. This happens whenever the arguments have integer values that fit into the native integer type and the mathematical result can be exactly represented as a native integer. This may be confusing in cases where floating point semantics are expected.</p>

<p>See <a href="http://man.he.net/man1/perlnumber">perlnumber(1)</a> for discussion of Perl&#39;s numeric semantics.</p>

<h1 id="CONSTANTS">CONSTANTS</h1>

<h2 id="Features">Features</h2>

<dl>

<dt id="have_signed_zero">have_signed_zero</dt>
<dd>

<p>Truth value indicating whether floating point zeroes carry a sign. If yes, then there are two floating point zero values: +0.0 and -0.0. (Perl scalars can nevertheless also hold an integer zero, which is unsigned.) If no, then there is only one zero value, which is unsigned.</p>

</dd>
<dt id="have_subnormal">have_subnormal</dt>
<dd>

<p>Truth value indicating whether there are subnormal floating point values.</p>

</dd>
<dt id="have_infinite">have_infinite</dt>
<dd>

<p>Truth value indicating whether there are infinite floating point values.</p>

</dd>
<dt id="have_nan">have_nan</dt>
<dd>

<p>Truth value indicating whether there are NaN floating point values.</p>

<p>It is difficult to reliably generate a NaN in Perl, so in some unlikely circumstances it is possible that there might be NaNs that this module failed to detect. In that case this constant would be false but a NaN might still turn up somewhere. What this constant reliably indicates is the availability of the <code>nan</code> constant below.</p>

</dd>
</dl>

<h2 id="Extrema">Extrema</h2>

<dl>

<dt id="significand_bits">significand_bits</dt>
<dd>

<p>The number of fractional bits in the significand of finite floating point values. The significand also has an implicit integer bit, not counted in this constant; the integer bit is always 1 for normalised values and always 0 for subnormal values.</p>

</dd>
<dt id="significand_step">significand_step</dt>
<dd>

<p>The difference between adjacent representable values in the range [1, 2] (where the exponent is zero). This is equal to 2^-significand_bits.</p>

</dd>
<dt id="max_finite_exp">max_finite_exp</dt>
<dd>

<p>The maximum exponent permitted for finite floating point values.</p>

</dd>
<dt id="max_finite_pow2">max_finite_pow2</dt>
<dd>

<p>The maximum representable power of two. This is 2^max_finite_exp.</p>

</dd>
<dt id="max_finite">max_finite</dt>
<dd>

<p>The maximum representable finite value. This is 2^(max_finite_exp+1) - 2^(max_finite_exp-significand_bits).</p>

</dd>
<dt id="max_number">max_number</dt>
<dd>

<p>The maximum representable number. This is positive infinity if there are infinite values, or max_finite if there are not.</p>

</dd>
<dt id="max_integer">max_integer</dt>
<dd>

<p>The maximum integral value for which all integers from zero to that value inclusive are representable. Equivalently: the minimum positive integral value N for which the value N+1 is not representable. This is 2^(significand_bits+1). The name is somewhat misleading.</p>

</dd>
<dt id="min_normal_exp">min_normal_exp</dt>
<dd>

<p>The minimum exponent permitted for normalised floating point values.</p>

</dd>
<dt id="min_normal">min_normal</dt>
<dd>

<p>The minimum positive value representable as a normalised floating point value. This is 2^min_normal_exp.</p>

</dd>
<dt id="min_finite_exp">min_finite_exp</dt>
<dd>

<p>The base two logarithm of the minimum representable positive finite value. If there are subnormals then this is min_normal_exp - significand_bits. If there are no subnormals then this is min_normal_exp.</p>

</dd>
<dt id="min_finite">min_finite</dt>
<dd>

<p>The minimum representable positive finite value. This is 2^min_finite_exp.</p>

</dd>
</dl>

<h2 id="Special-Values"><a id="Special"></a>Special Values</h2>

<dl>

<dt id="pos_zero">pos_zero</dt>
<dd>

<p>The positive zero value. (Exists only if zeroes are signed, as indicated by the <code>have_signed_zero</code> constant.)</p>

<p>If Perl is at risk of transforming floating point zeroes into integer zeroes (see <a href="./Data::Float.html#BUGS">&quot;BUGS&quot;</a>), then this is actually a non-constant function that always returns a fresh floating point zero. Thus the return value is always a true floating point zero, regardless of what happened to zeroes previously returned.</p>

</dd>
<dt id="neg_zero">neg_zero</dt>
<dd>

<p>The negative zero value. (Exists only if zeroes are signed, as indicated by the <code>have_signed_zero</code> constant.)</p>

<p>If Perl is at risk of transforming floating point zeroes into integer zeroes (see <a href="./Data::Float.html#BUGS">&quot;BUGS&quot;</a>), then this is actually a non-constant function that always returns a fresh floating point zero. Thus the return value is always a true floating point zero, regardless of what happened to zeroes previously returned.</p>

</dd>
<dt id="pos_infinity">pos_infinity</dt>
<dd>

<p>The positive infinite value. (Exists only if there are infinite values, as indicated by the <code>have_infinite</code> constant.)</p>

</dd>
<dt id="neg_infinity">neg_infinity</dt>
<dd>

<p>The negative infinite value. (Exists only if there are infinite values, as indicated by the <code>have_infinite</code> constant.)</p>

</dd>
<dt id="nan">nan</dt>
<dd>

<p>Not-a-number. (Exists only if NaN values were detected, as indicated by the <code>have_nan</code> constant.)</p>

</dd>
</dl>

<h1 id="FUNCTIONS">FUNCTIONS</h1>

<p>Each &quot;float_&quot; function takes a floating point argument to operate on. The argument must be a native floating point value, or a native integer with a value that can be represented in floating point. Giving a non-numeric argument will cause mayhem. See <a href="https://metacpan.org/pod/Params::Classify#is_number">&quot;is_number&quot; in Params::Classify</a> for a way to check for numericness. Only the numeric value of the scalar is used; the string value is completely ignored, so dualvars are not a problem.</p>

<h2 id="Classification1">Classification</h2>

<p>Each &quot;float_is_&quot; function returns a simple truth value result.</p>

<dl>

<dt id="float_class(VALUE)"><a id="float_class"></a><a id="float_class-VALUE"></a>float_class(VALUE)</dt>
<dd>

<p>Determines which of the five classes described above VALUE falls into. Returns &quot;NORMAL&quot;, &quot;SUBNORMAL&quot;, &quot;ZERO&quot;, &quot;INFINITE&quot;, or &quot;NAN&quot; accordingly.</p>

</dd>
<dt id="float_is_normal(VALUE)"><a id="float_is_normal"></a><a id="float_is_normal-VALUE"></a>float_is_normal(VALUE)</dt>
<dd>

<p>Returns true iff VALUE is a normalised floating point value.</p>

</dd>
<dt id="float_is_subnormal(VALUE)"><a id="float_is_subnormal"></a><a id="float_is_subnormal-VALUE"></a>float_is_subnormal(VALUE)</dt>
<dd>

<p>Returns true iff VALUE is a subnormal floating point value.</p>

</dd>
<dt id="float_is_nzfinite(VALUE)"><a id="float_is_nzfinite"></a><a id="float_is_nzfinite-VALUE"></a>float_is_nzfinite(VALUE)</dt>
<dd>

<p>Returns true iff VALUE is a non-zero finite value (either normal or subnormal; not zero, infinite, or NaN).</p>

</dd>
<dt id="float_is_zero(VALUE)"><a id="float_is_zero"></a><a id="float_is_zero-VALUE"></a>float_is_zero(VALUE)</dt>
<dd>

<p>Returns true iff VALUE is a zero. If zeroes are signed then the sign is irrelevant.</p>

</dd>
<dt id="float_is_finite(VALUE)"><a id="float_is_finite"></a><a id="float_is_finite-VALUE"></a>float_is_finite(VALUE)</dt>
<dd>

<p>Returns true iff VALUE is a finite value (either normal, subnormal, or zero; not infinite or NaN).</p>

</dd>
<dt id="float_is_infinite(VALUE)"><a id="float_is_infinite"></a><a id="float_is_infinite-VALUE"></a>float_is_infinite(VALUE)</dt>
<dd>

<p>Returns true iff VALUE is an infinity (either positive infinity or negative infinity).</p>

</dd>
<dt id="float_is_nan(VALUE)"><a id="float_is_nan"></a><a id="float_is_nan-VALUE"></a>float_is_nan(VALUE)</dt>
<dd>

<p>Returns true iff VALUE is a NaN.</p>

</dd>
</dl>

<h2 id="Examination">Examination</h2>

<dl>

<dt id="float_sign(VALUE)"><a id="float_sign"></a><a id="float_sign-VALUE"></a>float_sign(VALUE)</dt>
<dd>

<p>Returns &quot;<b>+</b>&quot; or &quot;<b>-</b>&quot; to indicate the sign of VALUE. An unsigned zero returns the sign &quot;<b>+</b>&quot;. <code>die</code>s if VALUE is a NaN.</p>

</dd>
<dt id="signbit(VALUE)"><a id="signbit"></a><a id="signbit-VALUE"></a>signbit(VALUE)</dt>
<dd>

<p>VALUE must be a floating point value. Returns the sign bit of VALUE: 0 if VALUE is positive or a positive or unsigned zero, or 1 if VALUE is negative or a negative zero. Returns an unpredictable value if VALUE is a NaN.</p>

<p>This is an IEEE 754 standard function. According to the standard NaNs have a well-behaved sign bit, but Perl can&#39;t see that bit.</p>

</dd>
<dt id="float_parts(VALUE)"><a id="float_parts"></a><a id="float_parts-VALUE"></a>float_parts(VALUE)</dt>
<dd>

<p>Divides up a non-zero finite floating point value into sign, exponent, and significand, returning these as a three-element list in that order. The significand is returned as a floating point value, in the range [1, 2) for normalised values, and in the range (0, 1) for subnormals. <code>die</code>s if VALUE is not finite and non-zero.</p>

</dd>
</dl>

<h2 id="String-conversion"><a id="String"></a>String conversion</h2>

<dl>

<dt id="float_hex(VALUE[,-OPTIONS])"><a id="float_hex"></a><a id="float_hex-VALUE--OPTIONS"></a>float_hex(VALUE[, OPTIONS])</dt>
<dd>

<p>Encodes the exact value of VALUE as a hexadecimal fraction, returning the fraction as a string. Specifically, for finite values the output is of the form &quot;<i>s</i><b>0x</b><i>m</i><b>.</b><i>mmmmm</i><b>p</b><i>eee</i>&quot;, where &quot;<i>s</i>&quot; is the sign, &quot;<i>m</i><b>.</b><i>mmmm</i>&quot; is the significand in hexadecimal, and &quot;<i>eee</i>&quot; is the exponent in decimal with a sign.</p>

<p>The details of the output format are very configurable. If OPTIONS is supplied, it must be a reference to a hash, in which these keys may be present:</p>

<dl>

<dt id="exp_digits"><b>exp_digits</b></dt>
<dd>

<p>The number of digits of exponent to show, unless this is modified by <b>exp_digits_range_mod</b> or more are required to show the exponent exactly. (The exponent is always shown in full.) Default 0, so the minimum possible number of digits is used.</p>

</dd>
<dt id="exp_digits_range_mod"><b>exp_digits_range_mod</b></dt>
<dd>

<p>Modifies the number of exponent digits to show, based on the number of digits required to show the full range of exponents for normalised and subnormal values. If &quot;<b>IGNORE</b>&quot; then nothing is done. If &quot;<b>ATLEAST</b>&quot; then at least this many digits are shown. Default &quot;<b>IGNORE</b>&quot;.</p>

</dd>
<dt id="exp_neg_sign"><b>exp_neg_sign</b></dt>
<dd>

<p>The string that is prepended to a negative exponent. Default &quot;<b>-</b>&quot;.</p>

</dd>
<dt id="exp_pos_sign"><b>exp_pos_sign</b></dt>
<dd>

<p>The string that is prepended to a non-negative exponent. Default &quot;<b>+</b>&quot;. Make it the empty string to suppress the positive sign.</p>

</dd>
<dt id="frac_digits"><b>frac_digits</b></dt>
<dd>

<p>The number of fractional digits to show, unless this is modified by <b>frac_digits_bits_mod</b> or <b>frac_digits_value_mod</b>. Default 0, but by default this gets modified.</p>

</dd>
<dt id="frac_digits_bits_mod"><b>frac_digits_bits_mod</b></dt>
<dd>

<p>Modifies the number of fractional digits to show, based on the length of the significand. There is a certain number of digits that is the minimum required to explicitly state every bit that is stored, and the number of digits to show might get set to that number depending on this option. If &quot;<b>IGNORE</b>&quot; then nothing is done. If &quot;<b>ATLEAST</b>&quot; then at least this many digits are shown. If &quot;<b>ATMOST</b>&quot; then at most this many digits are shown. If &quot;<b>EXACTLY</b>&quot; then exactly this many digits are shown. Default &quot;<b>ATLEAST</b>&quot;.</p>

</dd>
<dt id="frac_digits_value_mod"><b>frac_digits_value_mod</b></dt>
<dd>

<p>Modifies the number of fractional digits to show, based on the number of digits required to show the actual value exactly. Works the same way as <b>frac_digits_bits_mod</b>. Default &quot;<b>ATLEAST</b>&quot;.</p>

</dd>
<dt id="hex_prefix_string"><b>hex_prefix_string</b></dt>
<dd>

<p>The string that is prefixed to hexadecimal digits. Default &quot;<b>0x</b>&quot;. Make it the empty string to suppress the prefix.</p>

</dd>
<dt id="infinite_string"><b>infinite_string</b></dt>
<dd>

<p>The string that is returned for an infinite magnitude. Default &quot;<b>inf</b>&quot;.</p>

</dd>
<dt id="nan_string"><b>nan_string</b></dt>
<dd>

<p>The string that is returned for a NaN value. Default &quot;<b>nan</b>&quot;.</p>

</dd>
<dt id="neg_sign"><b>neg_sign</b></dt>
<dd>

<p>The string that is prepended to a negative value (including negative zero). Default &quot;<b>-</b>&quot;.</p>

</dd>
<dt id="pos_sign"><b>pos_sign</b></dt>
<dd>

<p>The string that is prepended to a positive value (including positive or unsigned zero). Default &quot;<b>+</b>&quot;. Make it the empty string to suppress the positive sign.</p>

</dd>
<dt id="subnormal_strategy"><b>subnormal_strategy</b></dt>
<dd>

<p>The manner in which subnormal values are displayed. If &quot;<b>SUBNORMAL</b>&quot;, they are shown with the minimum exponent for normalised values and a significand in the range (0, 1). This matches how they are stored internally. If &quot;<b>NORMAL</b>&quot;, they are shown with a significand in the range [1, 2) and a lower exponent, as if they were normalised. This gives a consistent appearance for magnitudes regardless of normalisation. Default &quot;<b>SUBNORMAL</b>&quot;.</p>

</dd>
<dt id="zero_strategy"><b>zero_strategy</b></dt>
<dd>

<p>The manner in which zero values are displayed. If &quot;<b>STRING=</b><i>str</i>&quot;, the string <i>str</i> is used, preceded by a sign. If &quot;<b>SUBNORMAL</b>&quot;, it is shown with significand zero and the minimum normalised exponent. If &quot;<b>EXPONENT=</b><i>exp</i>&quot;, it is shown with significand zero and exponent <i>exp</i>. Default &quot;<b>STRING=0.0</b>&quot;. An unsigned zero is treated as having a positive sign.</p>

</dd>
</dl>

</dd>
<dt id="hex_float(STRING)"><a id="hex_float"></a><a id="hex_float-STRING"></a>hex_float(STRING)</dt>
<dd>

<p>Generates and returns a floating point value from a string encoding it in hexadecimal. The standard input form is &quot;[<i>s</i>][<b>0x</b>]<i>m</i>[<b>.</b><i>mmmmm</i>][<b>p</b><i>eee</i>]&quot;, where &quot;<i>s</i>&quot; is the sign, &quot;<i>m</i>[<b>.</b><i>mmmm</i>]&quot; is a (fractional) hexadecimal number, and &quot;<i>eee</i>&quot; an optionally-signed exponent in decimal. If present, the exponent identifies a power of two (not sixteen) by which the given fraction will be multiplied.</p>

<p>If the value given in the string cannot be exactly represented in the floating point type because it has too many fraction bits, the nearest representable value is returned, with ties broken in favour of the value with a zero low-order bit. If the value given is too large to exactly represent then an infinity is returned, or the largest finite value if there are no infinities.</p>

<p>Additional input formats are accepted for special values. &quot;[<i>s</i>]<b>inf</b>[<b>inity</b>]&quot; returns an infinity, or <code>die</code>s if there are no infinities. &quot;[<i>s</i>][<b>s</b>]<b>nan</b>&quot; returns a NaN, or <code>die</code>s if there are no NaNs available.</p>

<p>All input formats are understood case insensitively. The function correctly interprets all possible outputs from <code>float_hex</code> with default settings.</p>

</dd>
</dl>

<h2 id="Comparison">Comparison</h2>

<dl>

<dt id="float_id_cmp(A,-B)"><a id="float_id_cmp"></a><a id="float_id_cmp-A--B"></a>float_id_cmp(A, B)</dt>
<dd>

<p>This is a comparison function supplying a total ordering of floating point values. A and B must both be floating point values. Returns -1, 0, or +1, indicating whether A is to be sorted before, the same as, or after B.</p>

<p>The ordering is of the identities of floating point values, not their numerical values. If zeroes are signed, then the two types are considered to be distinct. NaNs compare equal to each other, but different from all numeric values. The exact ordering provided is mostly numerical order: NaNs come first, followed by negative infinity, then negative finite values, then negative zero, then positive (or unsigned) zero, then positive finite values, then positive infinity.</p>

<p>In addition to sorting, this function can be useful to check for a zero of a particular sign.</p>

</dd>
<dt id="totalorder(A,-B)"><a id="totalorder"></a><a id="totalorder-A--B"></a>totalorder(A, B)</dt>
<dd>

<p>This is a comparison function supplying a total ordering of floating point values. A and B must both be floating point values. Returns a truth value indicating whether A is to be sorted before-or-the-same-as B. That is, it is a &lt;= predicate on the total ordering. The ordering is the same as that provided by <code>float_id_cmp</code>: NaNs come first, followed by negative infinity, then negative finite values, then negative zero, then positive (or unsigned) zero, then positive finite values, then positive infinity.</p>

<p>This is an IEEE 754r standard function. According to the standard it is meant to distinguish different kinds of NaNs, based on their sign bit, quietness, and payload, but this function (like the rest of Perl) perceives only one NaN.</p>

</dd>
</dl>

<h2 id="Manipulation">Manipulation</h2>

<dl>

<dt id="pow2(EXP)"><a id="pow2"></a><a id="pow2-EXP"></a>pow2(EXP)</dt>
<dd>

<p>EXP must be an integer. Returns the value two the the power EXP. <code>die</code>s if that value cannot be represented exactly as a floating point value. The return value may be either normalised or subnormal.</p>

</dd>
<dt id="mult_pow2(VALUE,-EXP)"><a id="mult_pow2"></a><a id="mult_pow2-VALUE--EXP"></a>mult_pow2(VALUE, EXP)</dt>
<dd>

<p>EXP must be an integer, and VALUE a floating point value. Multiplies VALUE by two to the power EXP. This gives exact results, except in cases of underflow and overflow. The range of EXP is not constrained. All normal floating point multiplication behaviour applies.</p>

</dd>
<dt id="copysign(VALUE,-SIGN_FROM)"><a id="copysign"></a><a id="copysign-VALUE--SIGN_FROM"></a>copysign(VALUE, SIGN_FROM)</dt>
<dd>

<p>VALUE and SIGN_FROM must both be floating point values. Returns a floating point value with the magnitude of VALUE and the sign of SIGN_FROM. If SIGN_FROM is an unsigned zero then it is treated as positive. If VALUE is an unsigned zero then it is returned unchanged. If VALUE is a NaN then it is returned unchanged. If SIGN_FROM is a NaN then the sign copied to VALUE is unpredictable.</p>

<p>This is an IEEE 754 standard function. According to the standard NaNs have a well-behaved sign bit, which can be read and modified by this function, but Perl only perceives one NaN and can&#39;t see its sign bit, so behaviour on NaNs is not standard-conforming.</p>

</dd>
<dt id="nextup(VALUE)"><a id="nextup"></a><a id="nextup-VALUE"></a>nextup(VALUE)</dt>
<dd>

<p>VALUE must be a floating point value. Returns the next representable floating point value adjacent to VALUE with a numerical value that is strictly greater than VALUE, or returns VALUE unchanged if there is no such value. Infinite values are regarded as being adjacent to the largest representable finite values. Zero counts as one value, even if it is signed, and it is adjacent to the smallest representable positive and negative finite values. If a zero is returned, because VALUE is the smallest representable negative value, and zeroes are signed, it is a negative zero that is returned. Returns NaN if VALUE is a NaN.</p>

<p>This is an IEEE 754r standard function.</p>

</dd>
<dt id="nextdown(VALUE)"><a id="nextdown"></a><a id="nextdown-VALUE"></a>nextdown(VALUE)</dt>
<dd>

<p>VALUE must be a floating point value. Returns the next representable floating point value adjacent to VALUE with a numerical value that is strictly less than VALUE, or returns VALUE unchanged if there is no such value. Infinite values are regarded as being adjacent to the largest representable finite values. Zero counts as one value, even if it is signed, and it is adjacent to the smallest representable positive and negative finite values. If a zero is returned, because VALUE is the smallest representable positive value, and zeroes are signed, it is a positive zero that is returned. Returns NaN if VALUE is a NaN.</p>

<p>This is an IEEE 754r standard function.</p>

</dd>
<dt id="nextafter(VALUE,-DIRECTION)"><a id="nextafter"></a><a id="nextafter-VALUE--DIRECTION"></a>nextafter(VALUE, DIRECTION)</dt>
<dd>

<p>VALUE and DIRECTION must both be floating point values. Returns the next representable floating point value adjacent to VALUE in the direction of DIRECTION, or returns DIRECTION if it is numerically equal to VALUE. Infinite values are regarded as being adjacent to the largest representable finite values. Zero counts as one value, even if it is signed, and it is adjacent to the positive and negative smallest representable finite values. If a zero is returned and zeroes are signed then it has the same sign as VALUE. Returns NaN if either argument is a NaN.</p>

<p>This is an IEEE 754 standard function.</p>

</dd>
</dl>

<h1 id="BUGS">BUGS</h1>

<p>As of Perl 5.8.7 floating point zeroes will be partially transformed into integer zeroes if used in almost any arithmetic, including numerical comparisons. Such a transformed zero appears as a floating point zero (with its original sign) for some purposes, but behaves as an integer zero for other purposes. Where this happens to a positive zero the result is indistinguishable from a true integer zero. Where it happens to a negative zero the result is a fourth type of zero, the existence of which is a bug in Perl. This fourth type of zero will give confusing results, and in particular will elicit inconsistent behaviour from the functions in this module.</p>

<p>Because of this transforming behaviour, it is best to avoid relying on the sign of zeroes. If you require signed-zero semantics then take special care to maintain signedness. Avoid using a zero directly in arithmetic and handle it as a special case. Any flavour of zero can be accurately copied from one scalar to another without affecting the original. The functions in this module all avoid modifying their arguments, and where they are meant to return signed zeroes they always return a pristine one.</p>

<p>As of Perl 5.8.7 stringification of a floating point zero does not preserve its signedness. The number-to-string-to-number round trip turns a positive floating point zero into an integer zero, but accurately maintains negative and integer zeroes. If a negative zero gets partially transformed into an integer zero, as described above, the stringification that it gets is based on its state at the first occasion on which the scalar was stringified.</p>

<p>NaN handling is generally not well defined in Perl. Arithmetic with a mathematically undefined result may either <code>die</code> or generate a NaN. Avoid relying on any particular behaviour for such operations, even if your hardware&#39;s behaviour is known.</p>

<p>As of Perl 5.8.7 the <b>%</b> operator truncates its arguments to integers, if the divisor is within the range of the native integer type. It therefore operates correctly on non-integer values only when the divisor is very large.</p>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="https://metacpan.org/pod/Data::Integer">Data::Integer</a>, <a href="https://metacpan.org/pod/Scalar::Number">Scalar::Number</a>, <a href="http://man.he.net/man1/perlnumber">perlnumber(1)</a></p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Andrew Main (Zefram) &lt;zefram@fysh.org&gt;</p>

<h1 id="COPYRIGHT">COPYRIGHT</h1>

<p>Copyright (C) 2006, 2007, 2008, 2010, 2012, 2017 Andrew Main (Zefram) &lt;zefram@fysh.org&gt;</p>

<h1 id="LICENSE">LICENSE</h1>

<p>This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Data::Float, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Data::Float</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Data::Float</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Data::Float.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
